#include<iostream>
#include<string>
#include<regex>
int main()
{
    //http请求
   // std::string s = "GET /bite/login/?user=lyl&pass=8888 HTTP/1.1\r\n";
   std::string s = "GET /bite/login/ HTTP/1.0";

    std::smatch matches;//捕捉容器
    std::regex e("(GET|POST) ([^?]*)(?:\\?(.*))? (HTTP/1.[01](?:\r\n|\r)?)");
    bool ret = std::regex_match(s,matches,e);
    if(!ret) return -1;
    for(auto& e : matches)
    {
        std::cout<<e<<std::endl;
    }
    return 0;
}